package com.example.software.service.impl;

import com.example.software.dto.ApplyEntityDTO;
import com.example.software.dto.WorkdayDTO;
import com.example.software.vo.workdayVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.software.utils.PageUtils;
import com.example.software.utils.Query;

import com.example.software.dao.WorkdayDao;
import com.example.software.entity.WorkdayEntity;
import com.example.software.service.WorkdayService;


@Service("workdayService")
public class WorkdayServiceImpl extends ServiceImpl<WorkdayDao, WorkdayEntity> implements WorkdayService {

    @Autowired
    private WorkdayDao workdayDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<WorkdayEntity> page = this.page(
                new Query<WorkdayEntity>().getPage(params),
                new QueryWrapper<WorkdayEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<workdayVO> getWorkdayList(WorkdayDTO workdayDTO) {


        return workdayDao.getWorkdayList(workdayDTO);
    }

    @Override
    public Long getWorkdayID(ApplyEntityDTO applyEntityDTO) {
        return workdayDao.getWorkdayID(applyEntityDTO);
    }

}